package com.xzhuang.task.controller;

public class BaseController {

	/***
	 * 
	 * @param pageIndex
	 *            当前页码
	 * @param pageSize
	 *            每页显示行数
	 * @return
	 * @throws Exception
	 */
	public int[] getLimitStartAndEnd(int start, int pageSize) throws Exception {
		int ret[] = new int[2];
		if (pageSize == 0) {
			throw new Exception("分页信息错误：pageSize 均不能为0");
		}
		// ret[0] = pageIndex * pageSize - pageSize;
		ret[0] = start;
		ret[1] = start + pageSize - 1;
		return ret;
	}
}
